package cn.tianya.irock.core;

import java.io.IOException;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

public class HttpResponse extends HttpServletResponseWrapper {
	private String redirectUrl;
	
	public HttpResponse(HttpServletResponse response) {
		super(response);
		redirectUrl = null;
	}

	public void setRedirect(String location) {
		try {
			super.sendRedirect(redirectUrl = location);
		} catch (IOException e) {
		}
	}
	
	public String getRedirectUrl() {
		return redirectUrl;
	}
	
	public void sendRedirect(String location) {
		try {
			super.sendRedirect(location);
		} catch (IOException e) {
		}
	}
}
